<?php
 class ShopAction extends Action{
 	public function index(){
 		$id=$_GET['id'];

 		// 商品信息
 		$shop=M('Shop');
 		$shoprow=$shop->where('id='.$id)->find();
 		$this->assign('shoprow',$shoprow);

 		// 评论信息
 		$db=M();
		$sql="select c.*,u.username from comment c,user u where shop_id={$id} and c.user_id=u.id";
 		$comments=$db->query($sql);
 		$this->assign('comments',$comments);
 		$this->display();
 	}
 }
?>